#!/usr/bin/perl
#target_mod.cgi
require './tgtman-lib.pl';

&ReadParse();

&header($text{'create_header'}, "", "index", 0, 1);

@tlist=&get_target_list();
my $gstr = &get_gstr();
#my $gstr = "aa";
print "<form name=modcrt action=crttgt.cgi method=post>\n";
print "<table class=mode1>\n";
print "<tr><td width=120><b>$text{'target_name'}</b></td><td>$gstr:<input name=tname class=text value=''></td><td><i>$text{'tnamenote'}</i></td></tr>\n";
print "<tr><td><b>$text{'target_device'}</b></td><td><input name=dev class=text></td><td><i>$text{'devnote'}</i></td></tr>\n";
print "<tr><td><b>$text{'config_user'}</b></td><td><input name=setaccount type='radio' value='y' onclick='on_click_setaccount_yes();'>Yes<input name=setaccount type=radio value='n' checked onclick='on_click_setaccount_no();'>No</td></tr>\n";
print "<tr><td><b>$text{'target_user'}</b></td><td><input name=tuser class=disabletext disabled=true value=''></td><td><i>$text{'usernote'}</i></td></tr>\n";
print "<tr><td><b>$text{'target_pwd'}</b></td><td><input name=tpwd type=password class=disabletext disabled=true></td><td><i>$text{'pwdnote'}</i></td></tr>\n";
print "<tr> </tr>";
print "<tr><td></td><td><input name=actcrt type=submit class=button1 value=$text{'submit_create'} onclick='return on_click();'></td></tr>\n";
print "</table>\n";

print "<p><input name=actparm type=hidden value=\'\'>\n";
#print "<p><input name=oldfullname type=hidden value=$tg->{'fullname'}>\n";
print "</form>\n";
&footer("index.cgi","Home");


print <<EOF;
<script>
function on_click()
{
}
function on_click_setaccount_yes()
{
	document.forms[0].tuser.disabled = false;
	document.forms[0].tpwd.disabled = false;
	document.forms[0].tuser.style.backgroundColor = "#ffffff";
	document.forms[0].tpwd.style.backgroundColor = "#ffffff";
	document.forms[0].actmod.disabled = false;
}
function on_click_setaccount_no()
{
        document.forms[0].tuser.disabled = true;
        document.forms[0].tpwd.disabled = true;
        document.forms[0].tuser.style.backgroundColor = "#d4d0c8";
        document.forms[0].tpwd.style.backgroundColor = "#d4d0c8";
	document.forms[0].tuser.value = "";
	document.forms[0].tpwd.value = "";
}
</script>
EOF
